﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace FileConvert
{
   public class FontClass
    {
        public static List<string> GetSystemFontList()
        {
            List<string> lstFont = new List<string>();
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
            {
                string fontParentName = "/usr/share/fonts";
                lstFont.Add(fontParentName);
                foreach (var item in System.IO.Directory.GetDirectories(fontParentName))
                {
                    lstFont.Add(item);
                }
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                string wi = Environment.GetEnvironmentVariable("windir");
                // Console.WriteLine(wi);
                lstFont.Add(System.IO.Path.Combine(wi, "fonts"));
            }
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
            {

            }
            return lstFont;
        }
    }
}
